package com.yiren.dbaa.util;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;

import com.yiren.dbaa.R;

/**
 * Created by WANGRONGXIANG
 * on 2022/4/14
 * Describe 车辆bitmap工具类
 */
public class CarBitmapUtil {

    public final static String CAR_NORMAL = "CAR_NORMAL"; //正常车辆
    public final static String CAR_JGD = "CAR_JGD";       //近光灯
    public final static String CAR_JSD = "CAR_JSD";       //警示灯
    public final static String CAR_WD = "CAR_WD";         //雾灯
    public final static String CAR_YGD = "CAR_YGD";       //远光灯
    public final static String CAR_YZD = "CAR_YZD";       //右转灯
    public final static String CAR_ZZD = "CAR_ZZD";       //左转灯
    public final static String CAR_SCD = "CAR_SCD";       //刹车灯

    public final static String CAR_JG_SCD = "CAR_JG_SCD"; //近光刹车灯
    public final static String CAR_SS_SCD = "CAR_SS_SCD"; //双闪刹车灯
    public final static String CAR_YZ_SCD = "CAR_YZ_SCD"; //右转刹车灯
    public final static String CAR_YG_SCD = "CAR_YG_SCD"; //远光刹车灯
    public final static String CAR_ZZ_SCD = "CAR_ZZ_SCD"; //左转刹车灯
    public final static String CAR_YG_SSD = "CAR_YG_SSD"; //远光双闪灯
    public final static String CAR_YG_JGD = "CAR_YG_JGD"; //远近交替灯

    /**
     * 设置不同灯光下的不同车辆模型图
     *
     * @param lightType 灯光类型
     */
    public static Bitmap getBitmap(Context context, String lightType) {
        Bitmap bitmap = null;
        switch (lightType) {
            case CAR_NORMAL:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_normal)).getBitmap();
                break;
            case CAR_JGD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_jgd)).getBitmap();
                break;
            case CAR_JSD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_jsd)).getBitmap();
                break;
            case CAR_WD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_wd)).getBitmap();
                break;
            case CAR_YGD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_ygd)).getBitmap();
                break;
            case CAR_YZD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_yzd)).getBitmap();
                break;
            case CAR_ZZD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_zzd)).getBitmap();
                break;
            case CAR_SCD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_scd)).getBitmap();
                break;
            case CAR_JG_SCD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_jg_scd)).getBitmap();
                break;
            case CAR_SS_SCD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_ss_scd)).getBitmap();
                break;
            case CAR_YZ_SCD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_yz_scd)).getBitmap();
                break;
            case CAR_YG_SCD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_yg_scd)).getBitmap();
                break;
            case CAR_ZZ_SCD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_zz_scd)).getBitmap();
                break;
            case CAR_YG_SSD:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_yg_ssd)).getBitmap();
                break;
            case CAR_YG_JGD:
                //bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.drawable.car_yg_jgd)).getBitmap();
                break;
            default:
                bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.mipmap.car_normal)).getBitmap();
                break;
        }
        return bitmap;
    }
}
